package com.springboot.demo.thread_pool;

/**
 * 自定义任务
 *
 * @author supu
 * @date 2019-03-26 10:10
 **/
public class CustomTask implements Runnable {
    private Integer index;

    public CustomTask(Integer index) {
        this.index = index;
    }

    public Integer getIndex() {
        return index;
    }

    @Override
    public void run() {
        System.out.println(Thread.currentThread().getName() +"-->" + getIndex() + "run");
        try {
            Thread.sleep(10);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
